/**
 * @file Utility.hh
 * @author Xiaoze Lin (linxiaoze96@gmail.com)
 * @brief Common utility functions and classes.
 * @version 0.1
 *
 * @copyright Copyright (c) 2024
 *
 */
#pragma once

#include <random>

namespace ifsim {

class Random
{
 public:
  Random() { ; }
  ~Random() { ; }

  void seed(unsigned int s) { srand(s); }

  int getInt(int low, int high)
  {
    if (low >= high) {
      return low;
    } else {
      return low + (rand() % (high - low + 1));
    }
  }

  // Wrapper function for Mersenne Twister pseudo-random generator
  void seedMt64Rand(unsigned s) { _mt64Rand.seed(s); }
  uint64_t mt64Rand() { return _mt64Rand(); }

 private:
  std::mt19937_64 _mt64Rand;  // 64-bit unsigned random number
};
}  // namespace ifsim